package com.example.activiti.config.inteceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Mr.yuan
 * @version v1.0
 * @date 2019/11/21 10:23
 **/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private WebInterceptor webInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webInterceptor)
                .addPathPatterns("/activiti/**")
                .addPathPatterns("/login/**")
                .excludePathPatterns("/login/user/login")
                .excludePathPatterns("/service/**");
    }
}
